<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : manageOrder.xsl
    Created on : February 22, 2013, 4:30 PM
    Author     : NganNLK60334
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <xsl:template match="/">
        <table border="4" >
            <tr>
                <th>orderID</th>
                <th>orderDate</th>
                <th>username</th>
                <th>orderTotal</th>
                <th>address</th>
                <th>note</th>
                <th>status</th>
            </tr>
            <xsl:for-each select="orders/order">
                <form method ="POST" action="AdminController">
                    <tr>
                        <td>
                            <xsl:value-of select = "orderID"/>

                            <xsl:element name="input">
                                <xsl:attribute name="type">hidden</xsl:attribute>
                                <xsl:attribute name="name">txtID</xsl:attribute>
                                <xsl:attribute name="value">
                                    <xsl:value-of select ='orderID'/>
                                </xsl:attribute>
                                <xsl:attribute name="readonly"></xsl:attribute>
                            </xsl:element>
                        </td>
                        <td>
                            <xsl:value-of select = "orderDate"/>
                        </td>

                        <td>
                            <xsl:value-of select = "usename"/>
                        </td>

                        <td>
                            <xsl:value-of select = "orderTotal"/>
                        </td>

                        <td>
                            <xsl:value-of select = "address"/>
                        </td>

                        <td>
                            <xsl:value-of select = "note"/>
                        </td>
                        <xsl:choose>
                        <xsl:when test="statusID=1">
                            <td>Chưa giao</td>
                        </xsl:when>
                        <xsl:when test="statusID=2">
                            <td>Đã giao</td>
                        </xsl:when>
                        <xsl:when test="statusID=3">
                            <td>Admin hủy</td>
                        </xsl:when>
                        <xsl:otherwise test="statusID=4">
                            <td>Khách hàng hủy</td>
                        </xsl:otherwise>
                        </xsl:choose>
                    </tr>
                </form>
            </xsl:for-each>
        </table>
    </xsl:template>
</xsl:stylesheet>
